package acwing;

import java.util.Scanner;

/**
 * @author xizizzz
 * @description: TODO
 * @date 2021-9-18下午 07:05
 */
public class Test1 {
    public static void main(String[] args) {
        final Scanner sc = new Scanner(System.in);
        int T = sc.nextInt();
        while (T-- > 0) {
            int min = Integer.MAX_VALUE;
            int n = sc.nextInt();
            int k = sc.nextInt();
            int[] arr = new int[n];
            for (int i = 0; i < n; i++) {
                arr[i] = sc.nextInt();
            }
            for (int i = 0; i < arr.length; i++) {
                if (k % arr[i] == 0) {
                    min = Math.min(min, k / arr[i]);
                }
            }
            System.out.println(min);
        }
    }
}
